package com.tourism.website.collection.mapper;

import com.tourism.website.collection.entity.Favorite;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tourismwebsite.collection.dto.FavoriteDTO;
import com.tourismwebsite.collection.query.FavoriteQuery;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LYC
 * @since 2024-06-06
 */
@Mapper
public interface FavoriteMapper extends BaseMapper<Favorite> {
    /**
     *添加收藏夹
     * @param
     * @return
     */
    @Insert("INSERT INTO favorite (favorite_id, article_id) VALUES (#{favoriteId}, #{articleId})")
    int saveFavorite(Integer favoriteId,Integer articleId);
    /**
     *删除收藏夹
     * @param
     * @return
     */
    int deleteBatchFavorite(List<Favorite> favoriteList);
    @Select("SELECT * FROM favorite WHERE favorite_id = #{favoriteId}")
    List<Favorite> selectFavorite(Integer favoriteId);

}
